package com.snowflake.ecatalog.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.snowflake.ecatalog.entity.CompanyCategory;

/**
 * 企业分类
 */
public interface CompanyCategoryDao extends PagingAndSortingRepository<CompanyCategory, Long>,
		JpaSpecificationExecutor<CompanyCategory> {
	@Modifying
	@Query("update CompanyCategory cc set cc.status = ?1 where cc.id=?2")
	void changeStatus(Integer status, Long id);

	List<CompanyCategory> findByStdIdAndStatus(Long stdId, int status);
}
